package xyz.yuzegod.megawalls.stats;

public class CurrencyPackage
{
    private int currency;
    private StringBuffer tip;
    private double boost;
    
    public CurrencyPackage(final int currency, final String tip) {
        this.boost = 0.0;
        this.currency = currency;
        this.tip = new StringBuffer((tip == null) ? "" : tip);
    }
    
    public void appendTip(final String text) {
        this.tip.append(text);
    }
    
    public String getTip() {
        return this.tip.toString();
    }
    
    public boolean isBoosted() {
        return this.boost > 0.0;
    }
    
    public void booster(final double boost, final String boostReason) {
        this.boost += boost;
        this.appendTip(" " + boostReason + "x" + (boost + 1.0) + "倍");
    }
    
    public int getCurrency() {
        return (this.boost == 0.0) ? this.currency : ((int)(this.currency * this.boost) + this.currency);
    }
    
    public double getBoost() {
        return this.boost;
    }
}
